<?xml version="1.0"?>
<XslTransformationInstruction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <InstanceId>Xsl Transform AddExtensionObject Sample</InstanceId>
  <Tags>
    <string>Xml</string>
  </Tags>
  <AdditionalAssemblies />
  <Code><![CDATA[using System.IO;
using xSolon.Instructions;
using System.Xml;
using System.Xml.Xsl;

public class ArgsGenerator : AbstractInstruction
{
    // Method to return arguments passed to the xsl transformation
    // Do not modify signature
    public XsltArgumentList GetXsltArgumentList()
    {
    	var result = new XsltArgumentList();
    	
    	result.AddExtensionObject("urn:myns", new MyExtensionObject());
    	
    	result.AddParam("Param1","","value 1");
    	
    	return result;
    }
    
    // Not used
    public override void Run()
    {
    
        throw new System.NotImplementedException();
    }

}

public class MyExtensionObject 
{
	public object MyMethod2(string obj)
	{
		return string.Format(
			"Passed: {0}",obj);
	}
	
	public object MyMethod()
	{
		return "from mymethod";
	}
}]]></Code>
  <XmlPath>F:\sc\instructions\trunk\core\xSolon.Instructions\ReleaseNotes.xml</XmlPath>
  <XslPath>F:\sc\java\MyT4Site\xsl\Versions.xslt</XslPath>
  <Encoding>
    <ValidValues>
      <string>ASCII</string>
      <string>Unicode</string>
      <string>UTF32</string>
      <string>UTF7</string>
      <string>UTF8</string>
    </ValidValues>
    <Value>UTF8</Value>
  </Encoding>
  <BeautifyResult>true</BeautifyResult>
  <Xml><![CDATA[<bookstore>
  <book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0">
    <title>The Autobiography of Benjamin Franklin</title>
    <author>
      <first-name>Benjamin</first-name>
      <last-name>Franklin</last-name>
    </author>
    <price>8.99</price>
  </book>
  <book genre="novel" publicationdate="1967" ISBN="0-201-63361-2">
    <title>The Confidence Man</title>
    <author>
      <first-name>Herman</first-name>
      <last-name>Melville</last-name>
    </author>
    <price>11.99</price>
  </book>
  <book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
    <title>The Gorgias</title>
    <author>
      <name>Plato</name>
    </author>
    <price>9.99</price>
  </book>
</bookstore>]]></Xml>
  <Xsl><![CDATA[<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns:myObj="urn:myns">

<!--Price conversion factor-->
<xsl:param name="conv" select="1.15"/>
<xsl:param name="Param1" select="notSet"/>
	
  <xsl:template match="bookstore">  	
  <bookstore>
  	<div>
  		This value is from the ExtensionObject: <xsl:value-of select="$Param1"/>
  	</div>
  <xsl:for-each select="book">
    <book>
    <xsl:copy-of select="node()"/>
       <new-price>
          <xsl:value-of select="myObj:MyMethod()"/>  
       	<br />
    	<xsl:value-of select="myObj:MyMethod2(./title)"/>        
       </new-price>
    </book>
  </xsl:for-each>
  </bookstore>
  </xsl:template>
</xsl:stylesheet>]]></Xsl>
</XslTransformationInstruction>